﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using shop.Model;
using CommonTools;

namespace shop.Bll.Logi
{
    public class SyncLogBll
    {
        public async Task<IEnumerable<TradeSyncLog>> QueryLog(DateTime begin, DateTime end, string flag)
        {
            return await DB.FSql.Select<TradeSyncLog>()
                .Where(a => a.Flag == flag && a.SyncBegin >= begin && a.SyncEnd <= end)
                .OrderBy(a=> a.SyncBegin)
                .ToListAsync();
        }



        public async Task<Result> DeleteLog(int id )
        {
            await DB.FSql.Delete<TradeSyncLog>()
                .Where(a => a.id == id)
                .ExecuteAffrowsAsync();

            return new Result(true);
        }






            
    }
}
